package com.beiye.drivertransport.adapter;

import android.content.Context;
import android.widget.TextView;

import com.android.frame.adapter.CommonAdapter;
import com.android.frame.adapter.ViewHolder;
import com.beiye.drivertransport.R;
import com.beiye.drivertransport.bean.SectionInspectionUseBean;

import java.util.List;

/**
 * Created by ky on 2018/5/7.
 */


public class SubAddUserApt extends CommonAdapter<SectionInspectionUseBean.RowsBean> {
    private final List<SectionInspectionUseBean.RowsBean> mList;
    private Context context;


    public SubAddUserApt(Context context, List<SectionInspectionUseBean.RowsBean> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
        this.context = context;
        this.mList = mList;
    }

    @Override
    public void convert(ViewHolder holder, SectionInspectionUseBean.RowsBean item, final int position) {
        TextView tv_name = holder.getView(R.id.tv_name2);
        TextView tv_deptName = holder.getView(R.id.tv_name3);
        String deptName = mList.get(position).getDeptName();
        String userName = mList.get(position).getUserName();
        if(userName==null)
        {
            tv_name.setText("");
        }else{

            tv_name.setText(userName);
        }
        if(deptName==null)
        {
            tv_deptName.setText("");
        }else{

            tv_deptName.setText(deptName);
        }

    }
}